<!DOCTYPE html>
<html>
	<head>
	    <meta charset="utf-8">
	    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
	    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
	    <title>Hello APP</title>
	    <link rel="stylesheet" type="text/css" href="../../css/index.css" />
	</head>
	<style type="text/css">
		.warp{width: 100%;}

		.title-img{width: 100%;}
		.title-img img{width: 100%;display: block;}

		.shaixuan-box{height: 44px;align-items: center;background: #FFFFFF;width: 100%;left: 0;top: 0;z-index: 99;}
		.shaixuan-box.fixed-sta{position: fixed;}
		.shaixuan-box .shaixuan-one{align-items: center;line-height: 50px;align-items: center;justify-content: center;position: relative;width: 25%;}
		.shaixuan-box .shaixuan-one span{line-height: 50px;}
		.shaixuan-box .shaixuan-one.on .all{color: #FF9502;}
		.shaixuan-box .shaixuan-one img{width: 5px;height: 13px;margin-left: 5px;}
		.tapcss{background: #f5f5f5}

		.img-box{position:relative;}
		.img-box span{position: absolute;top: 0;left: 0;background:#EF7209;color: #ffffff;font-size: 12px;width: 50px;height: 20px;
		border-radius: 0 0 6px 0;text-align: center;line-height: 20px;}
		.tuijian-box .shop-list .shop-one .shop-info .price-box .price{font-weight: normal;padding-right: 0;font-size: 16px;line-height: 20px;}
		.tuijian-box .shop-list .shop-one .shop-info .price-box .jifen{font-weight: normal;padding-right: 0;font-size: 14px;color: #FF9502;line-height: 20px;}
		.tuijian-box .shop-list .shop-one .shop-info .price-box .jifen i{font-size: 16px;line-height: 20px;}
		.tuijian-box .shop-list .shop-one .shop-info .price-box .p3{padding-left: 10px;box-sizing: border-box;}

	</style>
	<body>
		<div id="vue" class="warp">

			<!--标题图片-->
			<div class="title-img" id="height-warp">
				<img v-if="Pdata.topimage" :src="Pdata.topimage"/>
			</div>
			<div class="shaixuan-box flex" id="fixed-cont">
				<!-- <div class="shaixuan-one flex flex1 on" data-type="zonghe" tapmode onclick="tabType(this)"><span class="all">综合</span></div> -->
				<div class="shaixuan-one flex" data-type="price" tapmode onclick="tabType(this)">
					<span>价格</span>
					<img v-if="pType == 0" src="../../image/main0/shaixuan_0.png"/>
					<img v-if="pType == 1" src="../../image/main0/shaixuan_1.png"/>
					<img v-if="pType == 2" src="../../image/main0/shaixuan_2.png"/>
				</div>
				<div class="shaixuan-one flex" data-type="buynum" tapmode onclick="tabType(this)">
					<span>销量</span>
					<img v-if="xType == 0" src="../../image/main0/shaixuan_0.png"/>
					<img v-if="xType == 1" src="../../image/main0/shaixuan_1.png"/>
					<img v-if="xType == 2" src="../../image/main0/shaixuan_2.png"/>
				</div>
				<!-- <div class="shaixuan-one flex flex1" data-type="pinnum" tapmode onclick="tabType(this)">
					<span>好评</span>
					<img v-if="hType == 0" src="../../image/main0/shaixuan_0.png"/>
					<img v-if="hType == 1" src="../../image/main0/shaixuan_1.png"/>
					<img v-if="hType == 2" src="../../image/main0/shaixuan_2.png"/>
				</div> -->
			</div>
			<div id="zhanwei" style="display:none;width:100%;height:44px;"></div>

			<!--全部商品-->
			<div class="tuijian-box" style="display:none;" :style="{ display:(Pdata ? '':'none')}">
				<div class="shop-list flex">
					<div class="shop-one" v-for="(item,key) in Pdata.listData" :data-id="item.sid" :data-type="item.htype" tapmode onclick="open_goods(this)">
					 	<div class="img-box bgpic" :style="{backgroundImage:'url('+item.image+')'}"><span>新人价</span></div>
						<div class="shop-info">
					 		<div class="name han_2" v-text="item.title"></div>
							<div class="price-box flex">
	                            <div class="price" v-if="item.pricetype != 'score'" v-text="'¥'+item.price"></div>
								<div class="price" v-if="item.pricetype == 'scoreandrmb'">+</div>
								<div class="jifen" v-if="item.pricetype == 'score' || item.pricetype == 'scoreandrmb'" ><i v-text="item.unscore"></i>积分</div>
	                            <div class="p3" v-if="item.price_del && item.pricetype == 'rmb'" v-text="'¥' + item.price_del"></div>
	                            <div class="num-box flex1" v-text="'已售'+item.buy_nums"></div>
					 		</div>
					 	</div>
					</div>
				</div>
		    </div>

			<!--占位图-->
			<div class="nodata" style="display:none;" :style="{ display:(noData ? '':'none')}">
	            <img src="../../image/no_page/no_shop.png" />
	            <p>暂无商品</p>
	        </div>
			<!-- 底部 -->
	        <div class="bottom-box" :style="{ display:(loadingMsg ? '':'none')}">
	            <div class="msgbox" v-html="loadingMsg" style="color:#999;"></div>
	        </div>

		</div>
	</body>
</html>
<script type="text/javascript" src="../../script/base.min.js" id="loadjs" data-js="L/swiper.min,L/lazyload,L/h-tool"></script>
<script type="text/javascript">
	define(function (require, exports, module) {

		var order = "" ; orderval = "";
		_page.getData = function(loading) {
			lanYun.getVueData({url:'NewuserGoods/index',get:{page:lanYun.page,order:order,orderval:orderval},cache:0,loading:loading},function(ret) {
				//console.log(JSON.stringify(ret));
			});
		};

		lanYun.newVue('#vue',{
			pType:0,xType:0,hType:0,
			Pdata:{
				pinpai:{},
				listData:{}
			}
		},function() {
			_page.getData(1);
		});

		//滚动加载..
		new auiScroll({distance:200, listen:true},function(ret) {
			if($(window).scrollTop() < 2) ret.isToBottom = false;
			var d = ret.scrollTop / 208;
			// 滑动的高度
			var h = $('#height-warp').height();
            if(ret.scrollTop > h){
                $('#fixed-cont').addClass("fixed-sta");
                $('#zhanwei').show();
            }else {
                $('#fixed-cont').removeClass("fixed-sta");
                $('#zhanwei').hide();
            }

			if(!ret.isToBottom) return;
			_page.getData(0);
		});

		//切换类型
		tabType = function (tis){
			var dst = tis.dataset;
			var px = lanYun.vue.pType;
			var xl = lanYun.vue.xType;
			var hp = lanYun.vue.hType;
			var arr = [ '' ,'DESC','ASC'];
			order = dst.type;
			if (dst.type == 'price') {
				$(tis).siblings().removeClass('on');
				lanYun.vue.xType = 0;
				lanYun.vue.hType = 0;
				px ++;
				px = px % 3;
				lanYun.vue.pType = px;
				orderval = arr[px];
			}else if(dst.type == 'buynum'){
				$(tis).siblings().removeClass('on');
				lanYun.vue.pType = 0;
				lanYun.vue.hType = 0;
				xl ++;
				xl = xl % 3;
				lanYun.vue.xType = xl;
				orderval = arr[xl];
			}else if(dst.type == 'pinnum'){
				$(tis).siblings().removeClass('on');
				lanYun.vue.xType = 0;
				lanYun.vue.pType = 0;
				hp ++;
				hp = hp % 3;
				lanYun.vue.hType = hp;
				orderval = arr[hp];
			}else if(dst.type == 'zonghe'){
				$(tis).addClass('on');
				lanYun.vue.xType = 0;
				lanYun.vue.pType = 0;
				lanYun.vue.hType = 0;
			}
			lanYun.ajaxPageSta = 0; lanYun.page = 1;
			_page.getData(2);
		}

		//打开商品详情
		open_goods = function (tis) {
	        var dst = tis.dataset;
	        lanYun.openWin('goods/show', {
	            win:'none',
	            frameParam : dst,
	        });
	    }
	});
</script>
